﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
//using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.Globalization;
using System.Threading;
using Modele;

namespace vue
{
    public partial class Form1 : Form
    {

        /***************/
        /** attributs **/
        /***************/
        
        //lien vers la VUE
        private Vue vue;

        //Calques        
        private int nbre_Calque;
        private List<CheckBox> checkBox_calques;
        private List<Label> label_calques;

        //Outils
        private String mode;
        private String outils;

        //brush
        private System.Drawing.Color couleur;
        private int epaisseur;

        //Informations sur l'action d'écriture
        private bool cursorDown;
        System.Threading.Thread threadStroke;

        //Recherche
        private List<System.Drawing.Point> resultat_recherche; //liste de positions (System.Drawing.Point)
        /*Globalisation*/
        private System.Resources.ResourceManager RM = null;
        // Liste des CultureInfo
        private CultureInfo EnglishCulture = new CultureInfo("en");
        private CultureInfo FrenchCulture = new CultureInfo("fr");


        float zoom;
        Image image;

        /***************/
        /**  méthodes **/
        /***************/

        //constructeur
        public Form1(Vue _vue)
        {
            InitializeComponent();

            vue = _vue;
            
            nbre_Calque = 0;
            checkBox_calques = new List<CheckBox>();
            label_calques = new List<Label>();
            resultat_recherche = new List<System.Drawing.Point>();
            label0.Click += new System.EventHandler(label_Click);
            checkBox_calques.Add(checkBoxCalque0);
            label_calques.Add(label0);
            zoom = 0.0F;
            mode = "dessin";
            outils = "crayon";
            couleur = System.Drawing.Color.Black;
            epaisseur = 50;

            // Définition de la culture par défaut
            System.Threading.Thread.CurrentThread.CurrentUICulture = FrenchCulture;
            //System.Threading.Thread.CurrentThread.CurrentUICulture = EnglishCulture;
            // LeResourceManager prend en paramètre : nom_du_namespace.nom_de_la_ressource_principale
            RM = new System.Resources.ResourceManager("vue.Form1", typeof(Form1).Assembly);

            // Affecte la valeur de la ressource MainTitle à la proriété Text de la fenêtre principale
            //this.Text = RM.GetString("MainTitle");

            AfficherTexte();

            cursorDown = false;
            //inkPicture1.CursorDown += new Microsoft.Ink.InkCollectorCursorDownEventHandler(inkPicture1_CursorDown);
            inkPicture1.CursorDown += new Microsoft.Ink.InkCollectorCursorDownEventHandler(inkPicture1_CursorDown);
            inkPicture1.Click += new EventHandler(inkPicture1_Click);

            inkEdit1.UseMouseForInput = true;
        }

       
        /*
         * AfficherTexte(): permet de mettre à jour les chaines de caractères 
         * lors d'un changement de langue (localisation)
         */
        
        private void AfficherTexte()
        {
           
            
           this.fichierToolStripMenuItem.Text = RM.GetString("fichierToolStripMenuItem.Text");
           this.nouveauProjetToolStripMenuItem.Text = RM.GetString("nouveauProjetToolStripMenuItem.Text");
           this.ouvrirToolStripMenuItem.Text = RM.GetString("ouvrirToolStripMenuItem.Text");
           this.enregistrerToolStripMenuItem.Text = RM.GetString("enregistrerToolStripMenuItem.Text");
           this.enregisteToolStripMenuItem.Text = RM.GetString("enregisteToolStripMenuItem.Text");
           this.importerToolStripMenuItem.Text = RM.GetString("importerToolStripMenuItem.Text");
           this.exporterToolStripMenuItem.Text = RM.GetString("exporterToolStripMenuItem.Text");
           this.imprimerToolStripMenuItem.Text = RM.GetString("imprimerToolStripMenuItem.Text");
           this.quitterToolStripMenuItem.Text = RM.GetString("quitterToolStripMenuItem.Text");
           this.editionToolStripMenuItem.Text = RM.GetString("editionToolStripMenuItem.Text");
           this.annulerToolStripMenuItem.Text = RM.GetString("annulerToolStripMenuItem.Text");
           this.rétablirToolStripMenuItem.Text = RM.GetString("rétablirToolStripMenuItem.Text");
           this.couperToolStripMenuItem.Text = RM.GetString("couperToolStripMenuItem.Text");
           this.copierToolStripMenuItem.Text = RM.GetString("copierToolStripMenuItem.Text");
           this.collerToolStripMenuItem.Text = RM.GetString("collerToolStripMenuItem.Text");
           this.supprimerToolStripMenuItem.Text = RM.GetString("supprimerToolStripMenuItem.Text");
           this.calqueToolStripMenuItem.Text = RM.GetString("calqueToolStripMenuItem.Text");
           this.nouveauToolStripMenuItem.Text = RM.GetString("nouveauToolStripMenuItem.Text");

           this.tabManipulation.Text = RM.GetString("tabManipulation.Text");
           this.tabFormes.Text = RM.GetString("tabFormes.Text");
           this.tabDessin.Text = RM.GetString("tabDessin.Text");
           this.groupBox1.Text = RM.GetString("groupBox1.Text");

        }

        public void completeRefresh(Microsoft.Ink.Ink _ink , ArrayList _annotations){


           //MISE A JOUR DES BALISES

           Microsoft.Ink.Renderer rend = new Microsoft.Ink.Renderer();
           // render the combined strokes onto the PictureBox
           
           //MISE A JOUR DU INK
           inkPicture1.Ink.DeleteStrokes();
           inkPicture1.Refresh();

           if (_ink.Strokes.Count > 0)
           {
               inkPicture1.Ink.AddStrokesAtRectangle(_ink.Strokes, _ink.Strokes.GetBoundingBox());
               inkPicture1.Refresh();
           }
           
           Graphics g = inkPicture1.CreateGraphics();
               int i = 0; //variable de test
               IEnumerator it = _annotations.GetEnumerator();
               while (it.MoveNext())
               {
                   i++;
                   //Bitmap image_test = new Bitmap("C:/image_test.bmp");
                   Bitmap image_test =((Balise)it.Current).getIcone();
                   Console.WriteLine("coordonnées de la balise en cours de rafraichissement : {0} {1}", ((Balise)it.Current).getPoint().X, ((Balise)it.Current).getPoint().Y);
                   //conversion echelles différents entre le inkpicture et l ecran : 
                   double x=((Balise)it.Current).getPoint().X/(25.4)-(image_test.Width/2);
                   double y=((Balise)it.Current).getPoint().Y/(25.4)-(image_test.Height/2);
                   g.DrawImage(image_test, new Point((int)x, (int)y));
                   Console.WriteLine("Ajoute de l'annotation dans totalRefresh {0}", i);
                }



               updateScroll();
        }

        public void changerGraphics(Microsoft.Ink.Ink _combinedInk , ArrayList _annotations)
        {
            /*
            Microsoft.Ink.Ink combinedInk = new Microsoft.Ink.Ink();
            Microsoft.Ink.Renderer rend = new Microsoft.Ink.Renderer();
            //Microsoft.Ink.Renderer rend2 = new Microsoft.Ink.Renderer();
            Microsoft.Ink.Strokes strokes;

            // copy strokes from the InkPictures into a single Ink object
            strokes = inkPicture3.Ink.Strokes;
            combinedInk.AddStrokesAtRectangle(strokes, strokes.GetBoundingBox());
            strokes = inkPicture1.Ink.Strokes;
            combinedInk.AddStrokesAtRectangle(strokes, strokes.GetBoundingBox());
             */

            Microsoft.Ink.Renderer rend = new Microsoft.Ink.Renderer();

            // render the combined strokes onto the PictureBox
            using (Graphics g = inkPicture1.CreateGraphics())
            {
                int i=0; //variable de test
                IEnumerator it= _annotations.GetEnumerator();
                while (it.MoveNext())
                {
                    i++;
                    g.DrawImage(((Balise)it.Current).getIcone(), ((Balise)it.Current).getPoint());
                    Console.WriteLine("Ajoute de la balise {0}", i);
                }

                rend.Draw(g, _combinedInk.Strokes);
                //POINT A REPRENDRE
            }
            inkPicture1.Update();
        } 

        /*
         * Capte et gère l'évènement CursorDown de l'inkpicture 
         * 
         */
        private void inkPicture1_CursorDown(object sender, Microsoft.Ink.InkCollectorCursorDownEventArgs e)
        {
            // add extended property indicating the time the stroke started
            // STROKE_START_GUID is class level string via GUID generator
            Console.WriteLine("Cursor Down");
            //   cursorDown = true;
            //  Console.WriteLine("Cursor Down fin");
        }

        /*
         * Capte et gère l'évènement Click de l'inkpicture 
         * 
         */

        private void inkPicture1_Click(object sender, EventArgs e)
        {
            // add extended property indicating the time the stroke started
            // STROKE_START_GUID is class level string via GUID generator
            Console.WriteLine("Click");
            //   cursorDown = true;
            //  Console.WriteLine("Cursor Down fin");
        }


        /*
         * Capte et gère l'évènement Stroke de l'inkpicture 
         * 
         */
        private void inkPicture1_Stroke(object sender, Microsoft.Ink.InkCollectorStrokeEventArgs e)
        {
            cursorDown= false;
            Console.WriteLine("inkpicture");
            Console.WriteLine(e.Stroke.DrawingAttributes.Width.ToString());
            e.Stroke.DrawingAttributes.Width = epaisseur;
            Console.WriteLine(e.Stroke.DrawingAttributes.Width.ToString());
            vue.ActionZoneDessin(e.Stroke);
        }


        /*
         * Capte et gère l'évènement Click de l'item importer dans le menu Fichier 
         * 
         */

        private void importerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            String nom_fichier="";
            OpenFileDialog openFileDialog1 = new OpenFileDialog();
            openFileDialog1.InitialDirectory = "c:\\";
            openFileDialog1.Filter = "bitmap files (*.bmp)|*.bmp|jpeg files (*.jpg)|*.jpg|png files (*.png)|*.png|All files (*.*)|*.*";
            openFileDialog1.FilterIndex = 2;
            openFileDialog1.RestoreDirectory = true;
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                nom_fichier = openFileDialog1.FileName;
            }
            image= Image.FromFile(nom_fichier);

            Bitmap fond = new Bitmap(image);
            inkPicture1.Size = image.Size;
            inkPicture1.BackgroundImage = fond;
            splitContainer1.Panel1.AutoScrollMinSize = image.Size;
        }

        private void ouvrirToolStripMenuItem_Click(object sender, EventArgs e)
        {
            String nom_fichier = "";
            OpenFileDialog openFileDialog1 = new OpenFileDialog();
            openFileDialog1.InitialDirectory = "c:\\";
            openFileDialog1.Filter = "All files (*.*)|*.*|PAN projects (*.pan)|*.pan";
            openFileDialog1.FilterIndex = 2;
            openFileDialog1.RestoreDirectory = true;

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                nom_fichier = openFileDialog1.FileName;
            }

        }

        /*
         * Capte et gère l'évènement Click de l'item quitter dans le menu Fichier 
         * 
         */

        private void quitterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            {
                DialogResult res = MessageBox.Show("Voulez vous vraiment quitter ? ", "Attention", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (res == DialogResult.Yes)
                {
                    Close();
                }
            }
        }


        /*
         * Capte et gère l'évènement Click de l'item imprimer dans le menu Fichier 
         * 
         */
        private void imprimerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            printDialog1.ShowDialog();
        }


        /*
         * Capte et gère l'évènement Click de l'item nouveau dans le menu Fichier 
         * 
         */
        private void nouveauToolStripMenuItem_Click(object sender, EventArgs e)
        {
           nbre_Calque++;
           String nbre = nbre_Calque.ToString();
            
            CheckBox check=new CheckBox();
            check.AutoSize = true;
            check.BackColor = System.Drawing.Color.White;
            int loc = (nbre_Calque+1) * 20 + 1;
            check.Location = new System.Drawing.Point(16, loc);
            check.Name = "checkBoxCalque" + nbre;
            check.Size = new System.Drawing.Size(82, 21);
            check.TabIndex = 1;
            check.UseVisualStyleBackColor = false;
            check.Checked = true;         
            check.CheckedChanged+=new EventHandler(check_CheckedChanged);
            checkBox_calques.Add(check);           
            
            Label lab = new Label();
            lab.AutoSize = true;
            lab.BackColor = System.Drawing.SystemColors.ActiveCaption;
            lab.Location = new System.Drawing.Point(58, loc);
            lab.Name = "label"+nbre;
            lab.Size = new System.Drawing.Size(60, 17);
            lab.TabIndex = 2;
            lab.Text = "Calque"+nbre;
            lab.Click += new System.EventHandler(label_Click);

            groupBox1.Controls.Add(check);
            groupBox1.Controls.Add(lab);
            changerCalqueCourant(nbre_Calque-1);
            label_calques.Add(lab);

            splitContainer2.Panel2.AutoScrollMinSize=new Size(0,loc+21);

            vue.creeCalque();
           
        }


        /*
         * Capte et gère l'évènement Click sur le label représentant le calque courant
         * 
         */
        private void label_Click(object sender, EventArgs e)
        {
            Label lab = new Label();
            lab = (Label)sender;
            for (int i = 0; i <= nbre_Calque; i++)
            {
                label_calques[i].BackColor = SystemColors.ButtonHighlight;
                checkBox_calques[i].Visible = true;

            }
            lab.BackColor = SystemColors.ActiveCaption;
            int calque_courant =label_calques.IndexOf(lab);
            CheckBox check = (CheckBox)checkBox_calques[calque_courant];
            check.Visible = false;
            int numero_calque = 0;
            IEnumerator it=label_calques.GetEnumerator();
            //recherche du numero du calque correspondant au lab
            while(it.MoveNext() && !it.Current.Equals(lab)){
                numero_calque++;
                Console.WriteLine("recherche du calque");
            }
            Console.WriteLine("lab correspondant au calque {0}",numero_calque);
            vue.changerCalqueCourant(numero_calque+1); // +1 du à  la presence du document
            //permet une coherence entre le tableau de lab et la superposition des claques
            echanger_position_label(numero_calque, label_calques.Count - 1);

            vue.completeRefresh(); // rafraichissement de la fenetre
        }
        /*
         * permet de définir le calque d'indice i calque courant
         * 
         * */
        private void changerCalqueCourant(int n)
        {
            for (int i = 0; i <= nbre_Calque; i++)
            {
                if (i != n)
                {
                    Label lab = label_calques[n];
                    lab.BackColor = SystemColors.ButtonHighlight;
                    
                }
            }
           
            

        }
        
      /*
       * Click sur le bouton correspondant à l'outil crayon
       * 
       * 
       * */

        private void button1_Click(object sender, EventArgs e)
        {
            outils = "crayon";
            vue.changerMode(new Controleur.ModeCrayon(couleur, epaisseur));
            Console.WriteLine("Passage au mode {0} {1}", mode, outils);
        }

        /*
         * Click sur le bouton de choix de la couleur
         * provoque l'ouverture d'une fenetre de type ColorDialog
         * 
         * */
        private void buttonCouleur_Click(object sender, EventArgs e)
        {
            ColorDialog colorDialog1 = new ColorDialog();
            if (colorDialog1.ShowDialog() == DialogResult.OK)
            {
                buttonCouleur.BackColor = colorDialog1.Color;
                couleur = colorDialog1.Color;
                inkPicture1.DefaultDrawingAttributes.Color = colorDialog1.Color;
                vue.changerCouleur(colorDialog1.Color);
            }

        }
        

        private void button2_Click(object sender, EventArgs e)
        {
            mode = "manipulation";
            outils="main";
            vue.changerMode(new Controleur.ModeMain(couleur, epaisseur));
            Console.WriteLine("Passage au mode {0} {1}", mode, outils);
         
        }


        private void tabDessin_Click(object sender, EventArgs e)
        {
            mode = "dessin";
            outils = "crayon";
            vue.changerMode(new Controleur.ModeCrayon(couleur, epaisseur));
            Console.WriteLine("Passage au mode {0} {1}", mode, outils);
        }

        private void tabFormes_Click(object sender, EventArgs e)
        {
            mode = "formes";
            outils = "rectangle";
            vue.changerMode(new Controleur.ModeRectangle(couleur, epaisseur));
            Console.WriteLine("Passage au mode {0} {1}", mode, outils);
        }

        private void buttonRectangle_Click(object sender, EventArgs e)
        {
            mode = "formes";
            outils = "rectangle";
            vue.changerMode(new Controleur.ModeRectangle(couleur,epaisseur));
            Console.WriteLine("Passage au mode {0} {1}",mode,outils);

        }

        private void buttonEllipse_Click(object sender, EventArgs e)
        {
            mode = "formes";
            outils = "ellipse";
            vue.changerMode(new Controleur.ModeEllipse(couleur, epaisseur));
            Console.WriteLine("Passage au mode {0} {1}",mode,outils);
        }

        private void buttonCercle_Click(object sender, EventArgs e)
        {
            mode = "formes";
            outils = "cercle";
            vue.changerMode(new Controleur.ModeCercle(couleur, epaisseur));
            Console.WriteLine("Passage au mode {0} {1}",mode,outils);
        }

        private void buttonCarre_Click(object sender, EventArgs e)
        {
            mode = "formes";
            outils = "carre";
            vue.changerMode(new Controleur.ModeCarre(couleur, epaisseur));
            Console.WriteLine("Passage au mode {0} {1}",mode,outils);
        }

        private void inkEdit1_TextChanged(object sender, EventArgs e)
        {

        }

        private void fichierToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void buttonBalise_Click(object sender, EventArgs e)
        {
            mode = "balise";
            outils = "balise_attention";
            vue.changerMode(new Controleur.ModeBalise(couleur, epaisseur));
            Console.WriteLine("Passage au mode {0} {1}", mode, outils);

        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            Form2 ecritureForm = new Form2();
                    
        }


        /*
         * Changement de la valeur du zoom
         * 
         * 
         * */
        private void numericUpDownZoom_ValueChanged(object sender, EventArgs e)
        {
            zoom = ((float)numericUpDownZoom.Value) / 100f;
            Matrix m=new Matrix();
            m.Scale(zoom,zoom);
            if (image != null)
            {
                Size taille = new Size((int)(image.Size.Width * zoom), (int)(image.Size.Height * zoom));
                Image monImage = inkPicture1.BackgroundImage;
                Bitmap nouvelleImage = new Bitmap(image, taille);
                inkPicture1.Size = taille;
                inkPicture1.BackgroundImage = nouvelleImage;
                splitContainer1.Panel1.AutoScrollMinSize = taille;
               
            }
            inkPicture1.Renderer.SetViewTransform(m);
           
            vue.completeRefresh(); // rafraichissement de la fenetre
            updateScroll();
        }

        public void echanger_position_label(int i, int j)
        {
            Label tampon = label_calques[i];
            label_calques[i] = label_calques[j];
            label_calques[j] = tampon;

            CheckBox temp = checkBox_calques[i];
            checkBox_calques[i] = checkBox_calques[j];
            checkBox_calques[j] = temp;
                    

        }
      

        private Point p;


        public void modeMain(System.Drawing.Point[] tabPoints)
        {
            Point initial = (Point)tabPoints.GetValue(0);
            Point final = (Point)tabPoints.GetValue(tabPoints.Length - 1);
            
            int deplacementX = (int)((final.X - initial.X) / 25.4);
            int deplacementY = (int)((final.Y - initial.Y) / 25.4);
            p.X = Math.Max(-(int)((final.X - initial.X) / 25.4), -splitContainer1.Panel1.HorizontalScroll.Minimum);
            p.Y = Math.Max(-(int)((final.Y - initial.Y) / 25.4), -splitContainer1.Panel1.VerticalScroll.Minimum);
            splitContainer1.Panel1.HorizontalScroll.Value = p.X;
            splitContainer1.Panel1.VerticalScroll.Value = p.Y;
            updateScroll();
            
        }

        private void updateScroll()
        {
            splitContainer1.Panel1.HorizontalScroll.Value = p.X;
            splitContainer1.Panel1.VerticalScroll.Value = p.Y;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            MessageBox.Show("etat du scroll" + splitContainer1.Panel1.HorizontalScroll.Value.ToString() + splitContainer1.Panel1.VerticalScroll.Value.ToString());
            MessageBox.Show(splitContainer1.Panel1.HorizontalScroll.Maximum.ToString() + splitContainer1.Panel1.VerticalScroll.Maximum.ToString());
            MessageBox.Show(splitContainer1.Panel1.HorizontalScroll.Minimum.ToString() + splitContainer1.Panel1.VerticalScroll.Minimum.ToString());
        }

        private void tabManipulation_Click(object sender, EventArgs e)
        {

        }
        /*
         * changement de l'épaisseur du trait
         * 
         * 
         * 
         * */
        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            epaisseur = (int)numericUpDown1.Value;
            inkPicture1.DefaultDrawingAttributes.Width = epaisseur;

        }


        /*gestion des evenement checkBox 
         * activation et desactivation de la visibilité 
         */
        private void check_CheckedChanged(object sender, EventArgs e)
        {


            CheckBox checkBox = new CheckBox();
            checkBox = (CheckBox)sender;
            int numero_calque = 0;
            IEnumerator it = checkBox_calques.GetEnumerator();
            //recherche du numero du calque correspondant au lab
            int calque_courant = 0;
            for (int i = 0; i < nbre_Calque; i++)
            {
                numero_calque++;
                Console.WriteLine("recherche du calque");
                if (((Label)(label_calques[i])).BackColor.Equals(SystemColors.ActiveCaption))
                {
                    calque_courant = i;
                    MessageBox.Show(calque_courant.ToString());
                }

            }
            if (checkBox != checkBox_calques[calque_courant])
            {
                numero_calque = 0;
                IEnumerator it2 = checkBox_calques.GetEnumerator();
                //recherche du numero du calque correspondant au lab
                while (it2.MoveNext() && !it2.Current.Equals(checkBox))
                {
                    numero_calque++;
                    Console.WriteLine("recherche du calque");
                }
                Console.WriteLine("changement de la visibilité du calque {0}", numero_calque);
                vue.changeVisibility(numero_calque + 1); // +1 du à  la presence du document

                vue.completeRefresh(); // rafraichissement de la fenetre
            }
            else
            {
                checkBox.Checked = true;
            }
        }

        private void splitContainer1_SplitterMoved(object sender, SplitterEventArgs e)
        {

        }
        /**
        * @brief undoButton_Click
        * @brief Click sur le bouton undo
        * @param object sender : l'expéditeur de l'événement
        * @param EventArgs e : l'évènement
        * @return int : le nombre d'annulations réalisées
        */
        private void undoButton_Click(object sender, EventArgs e)
        {
            int nb_undo = vue.undo(1);
            if (nb_undo < 1)
            {
                undoButton.Enabled = false;
            }
            ///// /!\ unique annulation pour l'instant
        }

        /**
        * @brief undoButton_Click
        * @brief Click sur le bouton undo
        * @param object sender : l'expéditeur de l'événement
        * @param EventArgs e : l'évènement
        * @return int : le nombre d'actions refaites
        */
        private void redoButton_Click(object sender, EventArgs e)
        {
            vue.redo(1);
            ///// /!\ un seul redo pour l'instant
        }

        private void clearToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.vue.clear();
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void button29_Click(object sender, EventArgs e)
        {

        }

        private void button28_Click(object sender, EventArgs e)
        {

        }

        private void button27_Click(object sender, EventArgs e)
        {
            // recuperation des parametres de recherche
            string mot_cle="";
            inkEdit1.Recognize();
            mot_cle = inkEdit1.Text;
            
            bool recherche_dans_balise = checkBox1.Checked;
            bool recherche_dans_encre = checkBox2.Checked;
            bool recherche_dans_texte = checkBox3.Checked;

            Console.WriteLine("Lancement de la recherche mot clé reconnu : {0} / balise {1} / encre {2} / texte {3 } ", mot_cle, recherche_dans_balise, recherche_dans_encre, recherche_dans_texte);
           
            //lancement de la recherche 
            resultat_recherche = vue.lancer_recherche(recherche_dans_balise,
                                                      recherche_dans_encre,
                                                      recherche_dans_texte,
                                                      mot_cle);
            //Traitement du resultat
        }

        private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

    




      




    }
}
